﻿package frEngine.animateControler.colorControler
{
    import flash.events.*;
    import frEngine.animateControler.*;
    import frEngine.animateControler.keyframe.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.filters.fragmentFilters.*;

    public class BlightControler extends MeshAnimateBase
    {
        private var _blightFilter:BlightFilter;

        public function BlightControler()
        {
            this._blightFilter = new BlightFilter();
            this._blightFilter.blightness = 0;
            return;
        }// end function

        override public function get type() : int
        {
            return AnimateControlerType.blightAnimateControler;
        }// end function

        override protected function setTargetProperty(param1) : void
        {
            if (targetMesh)
            {
                this._blightFilter.blightness = param1;
            }
            return;
        }// end function

        override protected function setSurfaceHander(event:Event) : void
        {
            super.setSurfaceHander(event);
            if (targetMesh.material.materialParams.hasFilter(FilterType.BlightFilter) == false)
            {
                targetMesh.material.materialParams.addFilte(this._blightFilter);
            }
            return;
        }// end function

        override public function dispose(param1:Boolean = true) : void
        {
            targetMesh.material.materialParams.removeFilteByType(FilterType.BlightFilter);
            super.dispose();
            return;
        }// end function

    }
}
